cmake_minimum_required(VERSION 3.10)
project(videoV2_sample)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

set(TARGET video_sample)
#add_compile_options(-std=c++11 -fPIE -fstack-protector-all -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -s -pie -Wall) # safety
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0 -Dgoogle=mindxsdk_private)
#SET (CMAKE_BUILD_TYPE "Debug") # debug use

set(MX_SDK_HOME $ENV((MX_SDK_HOME))
set(FFMPEG_PATH /usr/local/ffmpeg)  #! your ffmpeg install location

include_directories(
        ${MX_SDK_HOME}/include
        ${MX_SDK_HOME}/opensource/include
        ${MX_SDK_HOME}/opensource/include/opencv4
        /usr/local/Ascend/ascend-toolkit/latest/runtime/include
        ${FFMPEG_PATH}/include
)

link_directories(
        ${MX_SDK_HOME}/lib
        ${MX_SDK_HOME}/opensource/lib
        ${MX_SDK_HOME}/lib/modelpostprocessors
        /usr/local/Ascend/ascend-toolkit/latest/acllib/lib64
        /usr/local/Ascend/driver/lib64/
        ${FFMPEG_PATH}/lib
)

add_executable(video_sample mainV2_video.cpp)
target_link_libraries(video_sample
        glog
        mxbase
        cpprest
        -lpthread
        -lm
        avformat
        avcodec
        avdevice
        avutil
        swresample
        )
install(TARGETS video_sample DESTINATION CMAKE_RUNTIME_OUTPUT_DIRECTORY)